<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Static Methods Example</title>
</head>
<body>
    <h1>Static Methods in JavaScript</h1>
    <button onclick="displayMessage()">Click to Call Static Method</button>
    <p id="output"></p>
</body>
</html>
    <script>
        // class Example {
        //     static greet() {
        //         return "Hello, this is a static method!";
        //     }
        // }
        // const example = new Example()
        // example.greet()

        // function displayMessage() {
        //     const message = Example.greet();
        //     document.getElementById("output").innerText = message;
        // }

        // 静态方法
        class Example {
            static sum(a,b){
                console.log(a+b)
            }
        }
        Example.sum(3,4)

        // 原型方法
        class Example1 {
            sum(a,b){
                console.log(a-b)
            }
        }
        let example = new Example1()
        example.sum(3,4)

        class student {
            constructor(name){
                this.name = name
                this.age = '男'
            }
        }

        // let 

        console.log('----------------------------------------------')


    </script>